pushd external/Chipmunk
scons ruby
popd

pushd external/Photon
scons ruby
popd

scons

rm -rf Aerosol.app

mkdir -p Aerosol.app/Contents/Frameworks
mkdir -p Aerosol.app/Contents/MacOS
mkdir -p Aerosol.app/Contents/Resources

cp -r macosx/universal_libs/*.framework Aerosol.app/Contents/Frameworks
cp -r ruby Aerosol.app/Contents/Resources/aerosol

cp -r external/Chipmunk/ruby/chipmunk.bundle Aerosol.app/Contents/Resources
cp -r external/Chipmunk/ruby/chipmunk_object.rb Aerosol.app/Contents/Resources

cp -r external/Photon/ruby/photonEXT.bundle Aerosol.app/Contents/Resources
cp -r external/Photon/ruby/photon.rb Aerosol.app/Contents/Resources
cp -r external/Photon/ruby/photon_var.rb Aerosol.app/Contents/Resources
cp -r external/Photon/ruby/photon_texture.rb Aerosol.app/Contents/Resources

cp -r macosx/init.rb Aerosol.app/Contents/Resources
cp -r macosx/English.lproj Aerosol.app/Contents/Resources
cp -r macosx/Info.plist Aerosol.app/Contents/
echo 'APPL????' > Aerosol.app/Contents/PkgInfo
mv prog Aerosol.app/Contents/MacOS/Aerosol

rm -rf Example\ Project/Aerosol.app
mv Aerosol.app Example\ Project
